// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  return cloud.database().collection("codes").where({
    contestant: event.contestant,
    firstTitle: event.firstTitle,
    secondTitle: event.secondTitle,
    thirdTitle: event.thirdTitle,
  }).get({
    success: res => {
      console.log("根据title和ID获取代码成功", res)
    },
    fail: res => {
      console.log("根据title和ID获取代码失败", res)
    }
  })
}